<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>information</title>
</head>

<body id="all">
    <p>姓名：<input type="text" id="name"></p>
    <p id="age">年龄：<input type="text"></p>
    <p>电话：<input type="text" id="tel"></p>
    <p>住址：<input type="text" id="adrr"></p>
    <button>确定</button>
    <script>
        var All = document.getElementById("all");
        var age1=document.getElementById("age");
        var p = document.createElement("p");
        var sex=document.createTextNode("性别：");
        var ip=document.createElement("input");
        ip.setAttribute("type","text");
        ip.setAttribute("id","sex");
        p.appendChild(sex);
        p.appendChild(ip);
        All.insertBefore(p,age1);
    </script>
</body>

</html>